package cn.brilliantfuture.commentry.util;

import java.io.IOException;

import org.apache.log4j.Logger;

import cn.brilliantfuture.commentry.profile.CommEntryProfile;

/**
 * 
 * Title: Communication Entry
 * 
 * Author:  LiTian  
 *
 * Date: 2011-11-15
 * 
 * Description: 公共方法类
 * 
 */
public abstract class BaseMessageImpl {
	protected static final Logger logger = Logger.getLogger(BaseMessageImpl.class); 
	
	protected String getRemoteUrl(){
		StringBuffer url = new StringBuffer();
		CommEntryProfile profile;
		try {
			profile = CommEntryProfile.getInstance();
			url.append("http://").append(profile.get(CommEntryProfile.ADCP_SERVICE_IP)).append(":");
			url.append(profile.get(CommEntryProfile.ADCP_SERVICE_PORT));
		} catch (IOException e) {
			logger.error("Get local source fail!");
			e.printStackTrace();
		}
		return url.toString();
	}
}
